<script setup lang="ts">
import { ArrowLeftBold, ArrowRight } from '@element-plus/icons-vue';
import { useRouter } from 'vue-router';
import { ref } from 'vue';

const router = useRouter();

const goBack = () => {
  router.back();
};

const goToAccount = () => {
  router.push('/account');
};
</script>

<template>
  <div id="setting">
    <div class="top">
      <el-icon @click="goBack">
        <ArrowLeftBold />
      </el-icon>
      <h3 style="margin: 0 auto">设置</h3>
    </div>
    <div class="main">
      <div class="info">
        <ul class="userinfo">
          <li @click="router.push('/userinfo')">
            <p style="padding-left: 10px;">个人信息</p>
            <div><el-icon>
                <ArrowRight />
              </el-icon></div>
          </li>
          <li @click="goToAccount">
            <p style="padding-left: 10px;">账号管理</p>
            <div><el-icon>
                <ArrowRight />
              </el-icon></div>
          </li>
        </ul>
      </div>
      <div class="shop">
        <ul class="shopinfo">
          <li @click="router.push('/service')">
            <p style="padding-left: 10px;">服务协议</p>
            <div><el-icon>
                <ArrowRight />
              </el-icon></div>
          </li>
          <li @click="router.push('/priva')">
            <p style="padding-left: 10px;">隐私政策</p>
            <div><el-icon>
                <ArrowRight />
              </el-icon></div>
          </li>
          <li @click="router.push('/mall')">
            <p style="padding-left: 10px;">关于我们</p>
            <div><el-icon>
                <ArrowRight />
              </el-icon></div>
          </li>
        </ul>
      </div>
      <div class="footer" @click="router.push('/login')">
        <p style="padding-left: 10px;">退出登录</p>
        <div><el-icon>
            <ArrowRight />
          </el-icon></div>
      </div>
    </div>
  </div>
</template>

<style scoped lang="scss">
* {
  margin: 0;
  padding: 0;
}

body {
  background-color: #F7F7F7;
}

#setting {
  width: 100%;
  height: 100%;

  .top {
    width: 100%;
    height: 30px;
    display: flex;
    align-items: center;
  }

  .main {
    width: 100%;
    height: 100%;
    overflow: hidden;

    .info {
      width: 90%;
      height: 100px;
      margin: 0 auto;
      margin-top: 10px;
      border-radius: 20px;
      background-color: #FFFFFF;
      border: 1px solid #E5E5E5;

      .userinfo {
        width: 100%;
        height: 100%;
        list-style: none;

        li {
          width: 100%;
          height: 50px;
          display: flex;
          justify-content: space-between;
          align-items: center;
        }
      }
    }

    .shop {
      width: 90%;
      height: 170px;
      margin: 0 auto;
      margin-top: 20px;
      border-radius: 20px;
      background-color: #FFFFFF;
      border: 1px solid #E5E5E5;

      .shopinfo {
        width: 100%;
        height: 100%;
        list-style: none;

        li {
          width: 100%;
          height: 50px;
          display: flex;
          justify-content: space-between;
          align-items: center;
        }
      }
    }

    .footer {
      width: 90%;
      height: 50px;
      margin: 0 auto;
      margin-top: 20px;
      border-radius: 20px;
      background-color: #FFFFFF;
      border: 1px solid #E5E5E5;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }
  }
}
</style>
